#pragma once
#include <string>

#include "Attack.h"
#include "SDLSprite.h"
#include "DbTable.h"

// Types de Pokemons
//enum Type{NORMAL,FIRE,WATER,PLANT,ELECTRIC,ICE,COMBAT,POISON,GROUND,FLY,PSY,BUG,ROCK,SPECTER,DRAGON,DARKNESS,STEEL};
const int SPRITESIZE_X = 90;
const int SPRITESIZE_Y = 80;

class Pokemon
	: public SDLSprite
{
public:

	Pokemon(int ID);
	~Pokemon();

	DbTable* GetTab() { return dbTable; }

	// --

	void DealDamage(Attack* atk,Pokemon* target);
	void TakeDamage(Attack* atk, Pokemon* pf);
	void Tick();
	void StoreAttackEffect(AttackEffect _fx);
	bool OnDeath();

	void InitSpritePosition();

	// --

	int GetType() const { return type; }
	int Get1X() const { return x1; }
	int Get1Y() const { return y1; }
	int Get2X() const { return x2; }
	int Get2Y() const { return y2; }
	int GetXBack() const { return xBack; }
	int GetYBack() const { return yBack; }
	int GetHP() const { return hitpoint; }
	int GetMaxHP() const { return maxHitpoint; }

	Attack* GetAtk1() const { return atk1; }
	Attack* GetAtk2() const { return atk2; }
	Attack* GetAtk3() const { return atk3; }
	Attack* GetAtk4() const { return atk4; }

	void SetAtk1(Attack* _atk) { atk1 = _atk; }
	void SetAtk2(Attack* _atk) { atk2 = _atk; }
	void SetAtk3(Attack* _atk) { atk3 = _atk; }
	void SetAtk4(Attack* _atk) { atk4 = _atk; }

	AttackEffect GetDebuff() const { return buff; }
	std::string GetName() const { return name; }

private:
	DbTable* dbTable;
	int x1, x2, xBack;
	int y1, y2, yBack;

protected:
	std::string name;
	AttackEffect buff;

	int currentId;
	int type;
	float hitpoint;
	float maxHitpoint;

	bool isDisabled;

	float damageModifier;
	float defenceModifier;

	Attack* atk1;
	Attack* atk2;
	Attack* atk3;
	Attack* atk4;
};
